//
//  DVAppSession.m
//  DVActivity
//
//  Created by pan Shiyu on 13-5-6.
//  Copyright (c) 2013年 pan Shiyu. All rights reserved.
//

#import "DVAppSession.h"
#import "UIDeviceAdditions.h"

@implementation DVAppSession

+ (DVAppSession*)sharedAppSession {
    static DVAppSession *sharedAppSession;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        sharedAppSession = [[self alloc] init];
    });
    return sharedAppSession;
}

#pragma mark - private getting methods
- (NSString *)uuid {
    if (_uuid == nil) {
#warning TODO psy uuid用来替代udid的东西，很重要，网上有CFUUid，瞅瞅去
    }
    return _uuid;
}

- (NSString*)appVersion{
    if (_appVersion == nil) {
        _appVersion = [UIDevice clientVersion];
    }
    return _appVersion;
}

- (NSString*)deviceId{
    if (_deviceId == nil) {
        _deviceId = [UIDevice deviceID];
    }
    return _deviceId;
}

- (NSString*)osVersion{
    if (_osVersion == nil) {
        _osVersion = [UIDevice currentDevice].systemVersion;
    }
    return _osVersion;
}

-(NSString*)screen{
    if (_screen == nil) {
        CGSize size = [UIScreen mainScreen].bounds.size;//TODO
        CGFloat screenScale = [[UIScreen mainScreen] scale];
        _screen = [NSString stringWithFormat:@"%.0f*%.0f",size.width * screenScale,size.height * screenScale];
    }
    return _screen;
}

- (NSString*)sessionId{
#warning TODO psy: 先手动创建？
    return nil;
    
}


@end
